Server Watch Plugin SDK Date: 6 Feb 2004
Release: 1.0
Main Page | Class Hierarchy | Class List | File List | Class Members | File Members | Related Pages

ISWPluginMenu Class Reference

#include <ISWPluginMenu.h>

List of all members.


Detailed Description

This interface is the plugin interface to Action Menu's in in Server Watch. An instance of this interface is passed to the plugin in the CreateMenu function, and the user creates the menu to be displayed using the ISWMenuContext::AddMenuItem function. The plugin can get context information to aid in the creation of the menu through the ISWMenuContext::GetMenuType and ISWMenuContext::GetMenuContext functions. When the menu item is triggered, Server Watch calls the SWMENUACTIONCALLBACK function specified in the fnPtr parameter during the AddMenuItem for that menu item.


Public Types

typedef void(__cdecl * SWMENUACTIONCALLBACK )(SWPluginServerStruct *pThisServer, ISWPluginMenu::SWMenuType menuType, ISWPluginMenu::ISWMenuContext *pMenuContext)
enum  SWMenuType { Undefined, AuxStat, UserList }

Public Member Functions

virtual SWMenuType GetMenuType ()=0
virtual ISWMenuContextGetMenuContext ()=0
 GetMenuContext returns the ISWMenuContext pointer for this menu.
virtual SWRESULT AddMenuItem (std::wstring strItemName, SWMENUACTIONCALLBACK fnPtr, unsigned int flags)=0
virtual ~ISWPluginMenu ()


Member Typedef Documentation

typedef void( __cdecl * ISWPluginMenu::SWMENUACTIONCALLBACK)(SWPluginServerStruct *pThisServer, ISWPluginMenu::SWMenuType menuType, ISWPluginMenu::ISWMenuContext *pMenuContext)
 

Typedef of the callback function signature used when notifying plugins of a plugin action. The instance of this function type (specificed with the action in AddMenuItem) is called whenever the user has selected an action

After the menu is created with AddMenuItem, the menu is displayed to the user. If the user clicks a menu item then the function associated with the action is executed.

Parameters:
pThisServer A SWPluginServerStruct that contains the information related to this server.
menuType The menutype that triggered this action.
pMenuContext The ISWMenuContext of the location that triggered this action.
Return values:
SW_OK Return this if the processing within this function was successful
SW_FAIL Return this if the processing within this function failed


Member Enumeration Documentation

enum ISWPluginMenu::SWMenuType
 

Denotes the type of action menu being created or worked with.

Enumeration values:
Undefined 
AuxStat  The action was triggered from the Auxiliary status field.
UserList  The action was triggered from a cell in the UserList.


Constructor & Destructor Documentation

virtual ISWPluginMenu::~ISWPluginMenu  )  [inline, virtual]
 


Member Function Documentation

virtual SWMenuType ISWPluginMenu::GetMenuType  )  [pure virtual]
 

GetMenuType returns the type of menu being created. Most likely a different set of menu items should be returned for different contexts

virtual ISWMenuContext* ISWPluginMenu::GetMenuContext  )  [pure virtual]
 

GetMenuContext returns the ISWMenuContext pointer for this menu.

virtual SWRESULT ISWPluginMenu::AddMenuItem std::wstring  strItemName,
SWMENUACTIONCALLBACK  fnPtr,
unsigned int  flags
[pure virtual]
 

AddMenuItem is used to add a menu item to the menu to be displayed. Menu items are displayed in the menu in the order they were added to the menu.

Parameters:
strItemName The text of the menu item.
fnPtr Function pointer to the function to call if this menu item is selected.
flags Bitmask of flags to specify menu properties.


The documentation for this class was generated from the following file:

Copyright (c) 2003-2004, Deep Fried Software. All rights reserved.